package cn.rxyb.core.thread;

import cn.hutool.core.thread.ThreadUtil;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author YJH
 * @version 1.0
 * @description 线程操作
 * @date 2020/7/2 14:47
 */
public class ThreadPool {

    private final static ThreadPoolExecutor poolExecutor = ThreadUtil.newExecutor(100, 1000);

    private final static ThreadPool threadPool = new ThreadPool();

    /**
     * 获取线程单例
     *
     * @return
     */
    public static ThreadPool getInstance() {
        return threadPool;
    }

    /**
     * 获取线程进行操作
     *
     * @return
     */
    public ThreadPoolExecutor getPoolExecutor() {
        return poolExecutor;
    }
}
